package day06home;

public class MethodDemo {
    public static void main(String[] args) {
       say();
       sayHi("zhangwanting");
       sayHello("zhangwanting",21);
       int a=getNum();
        System.out.println(a);
        int d = plus(2, 3);
        System.out.println(d);
        int[] e=teatArray();
        System.out.println("第一个数组元素的值为："+e[0]);
        int[] f=teatArray();
        System.out.println("数组的长度为："+f.length);
    }
    public static void say(){
        System.out.println("我叫zwt,今年21岁了");
    }
    public static void sayHi(String name){
        System.out.println("我叫"+name);
    }
    public static void sayHello(String name,int age){
        System.out.println("我叫"+name+",今年"+age+"岁了");
    }
    public static int getNum(){
        return 3;
    }
    public static int plus(int b,int c){
        int num=b+c;
        return  num;
    }
    public static int[] teatArray(){
        int[] arr=new int[10];
        for (int i = 0; i < arr.length; i++) {
            arr[i] = (int) (Math.random() * 100);
            System.out.println(arr[i]);
        }
        return arr;
    }
}
